function TextObj(pdObjs) {
	this.position=[];//瀵硅薄BBox L锛歭eft锛宼锛歵op锛宺锛歳ight锛宐锛歜ottom
	this.originPoint = []; // textObj origin coordinate [x, y]
	this.matrix=null;//鍙樻崲鐭╅樀 a,b,c,d,e,f
	this.textId=null;//瀵硅薄ID
	this.content=null;//瀛椾綋鍐呭
	this.bVertWriting = 0;
    /*
	this.m_bUseGID = false;
	this.m_nGID = 0;
	this.m_arrGID = [];
    */

	this.nGenStateID = -1;
	this.nClrStateID = -1;
	this.nGraphStateID = -1;
	this.nTextStateID = -1;
	this.nClipPathStateID = -1;
	this.type = null;
	this.charPosArray = [];
	
	this.m_nObjType = null;
	this.m_pdObjs = pdObjs;

	this.GetBBox = function (mtObj2Dev) {
	   
	    var rect = mtObj2Dev.TransFormRect(this.position[0], this.position[1], this.position[2], this.position[3]);
	    return rect;
	}
}

// set up prototype inheritance chain
 setupInheritPrototype(TextObj, PageObj);

TextObj.prototype.SetContent=function(content){
		this.content=content;
};
TextObj.prototype.GetContent=function(){
		return this.content;
};
TextObj.prototype.SetTextId=function(textId){
		this.textId=textId;
};
TextObj.prototype.GetTextId=function(){
		return this.textId;
};
TextObj.prototype.SetPosition=function(position){
		this.position=position;
};
TextObj.prototype.GetPosition=function(){
		return this.position;
};
TextObj.prototype.SetOriginPoint=function(point){
		this.originPoint=point;
};
TextObj.prototype.GetOriginPoint=function(){
		return this.originPoint;
};
TextObj.prototype.ParseJson = function (arrayData) {
    //var text = this;
    this.type = arrayData[0];
    this.SetTextId(arrayData[1]);
    this.SetContent(arrayData[9]);
    this.bVertWriting = arrayData[10];
    this.SetPosition(stringArr2NumArr(arrayData[2]));
    this.SetOriginPoint(stringArr2NumArr(arrayData[11]));
    this.SetMatrix(stringArr2NumArr(arrayData[3]));
    this.nGraphStateID = arrayData[6];
    this.nClrStateID = arrayData[7];
    this.nTextStateID = arrayData[8];
    this.nGenStateID = arrayData[4];
    this.nClipPathStateID = arrayData[5];
    if (arrayData[12] != undefined && arrayData[12] != null)
        this.charPosArray = stringArr2NumArr(arrayData[12]);
};

TextObj.prototype.ParseFromBin = function (rd) {
    this.textId = rd.readUint32();
    var nMatrixID = rd.readUint16();
    this.matrix = this.m_pdObjs.GetMatrixByID(nMatrixID);

    var left = rd.readFloat32();
    var top = rd.readFloat32();
    var right = rd.readFloat32();
    var bottom = rd.readFloat32();
    this.position = [left, top, right, bottom];

    var x = rd.readFloat32();
    var y = rd.readFloat32();
    this.originPoint = [x, y];

    this.bVertWriting = rd.readByte();
    /*
    this.m_bUseGID = rd.readByte();
    if (1 == this.m_bUseGID) {
        this.m_nGID = rd.readInt32();

        for (var i = 0; i < this.m_nGID; i++) {
            this.m_arrGID[i] = rd.readUint16();
        }
    }
    else {
        var nContentLen = rd.readInt32();
        this.content = rd.readString(nContentLen);
    }
    */
    var nContentLen = rd.readInt32();
    this.content = rd.readString(nContentLen);
    var nChar = rd.readUint32();

    for (var i = 0; i < nChar; i++) {
        var charPosArray = rd.readFloat32();
        this.charPosArray.push(charPosArray);
    }
}